<template>
    <div class="talk">
        <a-button type="primary" @click="getLoveTalk">获取一句土味情话</a-button>
        <ul>
            <li v-for="talk in talkStore.talkList" :key="talk.id">{{ talk.title }}</li>
        </ul>
    </div>
</template>

<script setup lang="ts" name="LoveTalk">
import { useTalkStore } from '@/store/lovetalk'
import AntDesignVue from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import { Button as AButton } from 'ant-design-vue';

const talkStore = useTalkStore()// 得到一个专门保存loveTalk相关的store

// 方法
function getLoveTalk() {
    talkStore.getATalk()// 调用store的方法
}
</script>

<style scoped>
.talk {
    background-color: rgb(252, 253, 253);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
}
</style>